package com.sammy.appmonitor.contentprovider;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

import com.sammy.appmonitor.contentprovider.MyContract.MessagesOutColums;

public class MyDatabase extends SQLiteOpenHelper {

	private static final String DATABASE_NAME = "recordstore.db";

	private static final int VER_LAUNCH = 1;
	private static final int DATABASE_VERSION = VER_LAUNCH;

	interface Tables {
		String MESSAGES_OUT = "msgsout";
	}

	public MyDatabase(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		 
		 db.execSQL("CREATE TABLE " + Tables.MESSAGES_OUT + " (" +
		 BaseColumns._ID + " INTEGER PRIMARY KEY AUTOINCREMENT," +
		 MessagesOutColums.MESSAGE + " TEXT," +
		 MessagesOutColums.RECORD_TIME + " INTEGER )"
		 );
		 		 
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
